window.onload=function(){
    list()
}
function list(){
    $ajax({
        url:topApi,
        method:'get',
        success:function(e){
           if(e.code === 200){
               let hotTop = e.artists;
               console.log(hotTop);
              let  str =''
              hotTop.forEach(function(item,index){
                  str+=`<li class="song-list-li">
                  <span class="song-list-num">${index}</span>
                  <span class="song-list-rank">20%</span>

                  <div class="song-main">
                      <a href="" class="song-link-img">
                          <img src="${item.picUrl}" alt="" class="song-link-pic">
                      </a>
                      <a href="" title="${item.alias[0]}" class="song-name">${item.alias[0]}</a>
                      <div class="song-dropmenu">
                          <a href="#" class="song-dropmenu-bgs song-dropmenu-bg1" title="播放"></a>
                          <a href="#" class="song-dropmenu-bgs song-dropmenu-bg2" title="添加到歌单"></a>
                          <a href="#" class="song-dropmenu-bgs song-dropmenu-bg3" title="分享"></a>
                      </div>
                  </div>
                  <a href="" class="songer-link">${item.name}</a>
                  <span class="song-time">00:00</span>
              </li>`
              })
              const songList=document.querySelector('.song-list-ul')
              songList.innerHTML=str
           }
        }
    })
}